package com.liuugoqing.structural.decorator;

/**
 * @Author : liugq
 * @Date : 2022/7/4 16:24
 * @See : 参考类
 * @Since： JDK1.8
 * @Version : 1.0
 */
public class Egg extends Garnish {


    public Egg(FastFood fastFood) {
        super(fastFood, 1, "加鸡蛋");
    }

    @Override
    public float cost() {
        return super.getPrice() + getFastFood().getPrice();
    }

    @Override
    public String getDesc() {
        return super.getDesc() + getFastFood().getDesc();
    }
}
